<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <meta name="viewport" content="width=640,target-densitydpi=device-dpi,user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name='author' content='网站建设：智杰科技'>
  <title></title>
  <meta name="keywords" content="">
  <meta name="description" content="">
  <link href="css/public.css" rel="stylesheet" type="text/css" />
  <link href="css/content.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <header id="publicNav"></header>
  <div class="main-wrap">
    <h6 class="top-info-box">案例赏识</h6>
    <div class="detail-box">
      <p class="title"></p>
      <p class="post-date"></p>
      <div id="projectDetailBox"></div>
      <div class="btn-box clearfix">
        <a id="prevNewsBtn" class="btn-item pre fl">
          <span class="fr">上一篇：</span>
          <p></p>
          <i class="iconfont"></i>
        </a>
        <a id="nextNewsBtn" class="btn-item next fr">
          <span class="fl">下一篇：</span>
          <p></p>
          <i class="iconfont"></i>
        </a>
      </div>
    </div>
  </div>
  <div id="publicTool"></div>
  <script src="js/jquery.min.js"></script>
  <script src="js/public.js"></script>
  <script>
    function getDetail () {
			var id = getQueryString('id')
			if (!id) {
				alert('文章不存在！')
				window.location.href = 'index.html'
			}
			$.ajax({
				type: 'POST',
				url: ajaxUrlObj['GET_CASES_DETAIL'],
				data: {id:id},
				success: function(rep){
          console.log(rep)
          if (typeof rep === 'string') {
						rep = JSON.parse(rep)
					}
					if (rep.code == 1){
            rep = JSON.parse(rep.data)
						var data = rep.data ? rep.data : rep
            $(".title").html(data.caseName)
            $(".post-date").html('发布时间：'+data.createtime)
            var str=''
						for(var i =0,l = data.caseImageList.length;i<l;i++){
							str+='<div class="img-item"><img src="'+host+data.caseImageList[i].imageUrl+'"></div>'
            }
            $("#projectDetailBox").html(str)
						if (rep.nextPage > 0 ) {
							$("#nextNewsBtn").attr("href",'project_details.html?id='+rep.nextPage).find("p").html(rep.nextName)
						} else {
							$("#nextNewsBtn").hide()
						}
						if (rep.lastPage > 0 ) {
							$("#prevNewsBtn").attr("href",'project_details.html?id='+rep.lastPage).find("p").html(rep.lastName)
						} else {
							$("#prevNewsBtn").hide()
            }
            if (data.seo) {
							$("title").html(data.seo.title)
							$('meta[name="keywords"]').attr("content",data.seo.keyword)
							$('meta[name="description"]').attr("content",data.seo.descs)
						}
					}
				},
				error: function(error){
					console.log(error)
					errorCb && errorCb(error)
				}
			});
		}
		getDetail()
  </script>
</body>

</html>